package c.x.jy.dao.dao;

import c.x.jy.dao.dto.FanEntityDto;
import c.x.jy.dao.dto.OrderEvaluateEntityDto;
import c.x.jy.dao.entity.OrderEvaluateEntity;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * 会员评价表
 * 
 * @author amwhyh
 * @email xxx@xx.com
 * @date 2021-05-25 10:50:33
 */
@Mapper
public interface OrderEvaluateDao extends BaseMapper<OrderEvaluateEntity> {
    @Select("select oe.*,m.headimgurl as memberImage,m.nickname as memberNickName  from t_order_evaluate oe LEFT JOIN t_member m on m.id=oe.member_id where oe.teacher_id=${teacherId}")
    List<OrderEvaluateEntityDto> getByTeacherId(Long teacherId);


    @Select("select oe.*,m.headimgurl as memberImage,m.nickname as memberNickName,t.nickname as teacherNickName  from (t_order_evaluate oe LEFT JOIN t_member m on m.id=oe.member_id) LEFT JOIN t_teacher t on t.id=oe.teacher_id  ${ew.customSqlSegment}")
    IPage<OrderEvaluateEntityDto> querypage(IPage<OrderEvaluateEntityDto> page,@Param(Constants.WRAPPER) QueryWrapper<OrderEvaluateEntityDto> query);
}

